package com.mlk.report.controller;

import com.mlk.core.component.page.Page;
import com.mlk.core.component.page.Pager;
import com.mlk.core.util.ServerResponse;
import com.mlk.engSystem.po.EngSysEmp;
import com.mlk.engSystem.service.EngSysEmpService;
import com.mlk.engSystem.vo.EngSysEmpVO;
import com.mlk.engUser.service.EngUserService;
import com.mlk.waste.po.EngWasteUserOrder;
import com.mlk.waste.service.EngWasteUserOrderService;
import com.mlk.waste.vo.EngWasteOrderVO;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/eng/report")
public class ReportController {
    @Resource
    private EngSysEmpService engSysEmpService;
    @Resource
    private EngWasteUserOrderService engWasteUserOrderService;

    /**
     * 返回业务统计首页
     * @return
     */
    @RequestMapping("index")
    public String index(){
        return "report/listReport";
    }

    /**
     * 业务员当天分页数据展示
     * @param
     * @return
     */
    @RequestMapping("listReportPage")
    @ResponseBody

    public Pager listReportPage(EngSysEmpVO engSysEmpVO){
        return this.engSysEmpService.listReportPage(engSysEmpVO);
    }

    /**
     * 客户订单统计分页数据展示
     * @param
     * @return
     */
    @RequestMapping("customerOrderCount")
    @ResponseBody

    public Pager customerOrderCount(EngWasteOrderVO engWasteOrderVO){
        return this.engWasteUserOrderService.customerOrderCount(engWasteOrderVO);
    }

    /**
     * 业务汇总
     * @param
     * @return
     */
    @RequestMapping("businessSummary")
    @ResponseBody

    public EngWasteOrderVO businessSummary(EngWasteOrderVO engWasteOrderVO){
        return this.engWasteUserOrderService.businessSummary(engWasteOrderVO);
    }
}
